<?php

/**
 * Usuario form base class.
 *
 * @method Usuario getObject() Returns the current form's model object
 *
 * @package    cronos-doctrine
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseUsuarioForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'              => new sfWidgetFormInputHidden(),
      'user_id'         => new sfWidgetFormInputText(),
      'empresa_id'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Empresa'), 'add_empty' => false)),
      'agente_id'       => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('UserAgente'), 'add_empty' => false)),
      'titulo_id'       => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Titulo'), 'add_empty' => false)),
      'parroquia_id'    => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Parroquia'), 'add_empty' => false)),
      'referido_id'     => new sfWidgetFormInputText(),
      'usuario_cod'     => new sfWidgetFormInputText(),
      'nombre'          => new sfWidgetFormInputText(),
      'apellido'        => new sfWidgetFormInputText(),
      'punto_lealtad'   => new sfWidgetFormInputText(),
      'foto'            => new sfWidgetFormInputText(),
      'status'          => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('LlamadaStatus'), 'add_empty' => true)),
      'nota_fija'       => new sfWidgetFormTextarea(),
      'depuracion'      => new sfWidgetFormInputText(),
      'depuracion_nota' => new sfWidgetFormTextarea(),
      'llamadas_nr'     => new sfWidgetFormInputText(),
      'num_masc'        => new sfWidgetFormInputText(),
      'created_at'      => new sfWidgetFormDateTime(),
      'updated_at'      => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'              => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'user_id'         => new sfValidatorInteger(array('required' => false)),
      'empresa_id'      => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Empresa'), 'required' => false)),
      'agente_id'       => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('UserAgente'))),
      'titulo_id'       => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Titulo'))),
      'parroquia_id'    => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Parroquia'))),
      'referido_id'     => new sfValidatorInteger(array('required' => false)),
      'usuario_cod'     => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'nombre'          => new sfValidatorString(array('max_length' => 255)),
      'apellido'        => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'punto_lealtad'   => new sfValidatorPass(array('required' => false)),
      'foto'            => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'status'          => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('LlamadaStatus'), 'required' => false)),
      'nota_fija'       => new sfValidatorString(array('required' => false)),
      'depuracion'      => new sfValidatorInteger(array('required' => false)),
      'depuracion_nota' => new sfValidatorString(array('required' => false)),
      'llamadas_nr'     => new sfValidatorInteger(array('required' => false)),
      'num_masc'        => new sfValidatorInteger(array('required' => false)),
      'created_at'      => new sfValidatorDateTime(),
      'updated_at'      => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('usuario[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Usuario';
  }

}
